package com.example.taigame;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;

import com.example.dialog.MoboDialog;
import com.example.dialog.MoboProgressDialog;

public class BaseActivity extends FragmentActivity{
	
	 private MoboProgressDialog _progressDialog;
	
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		MyApp._currentActivity = this;
		_progressDialog = new MoboProgressDialog(this);
	}
	
	
	public void showProgressDialog(String text, boolean isAnimation) {
        _progressDialog.show(text);
    }
 
    /**
     * An progress dialog neu co show.
     */
    public void hideProgressDialog() {
        if (_progressDialog != null) {
            if (_progressDialog.isShowing())
                _progressDialog.dimistDialog();
        }
    }
 
    /**
     * An Mobo dialog voi 2 nut OK hoac Huy.
     */
    public void showOkDialog(String text, View.OnClickListener okClick) {
        MoboDialog dlg = new MoboDialog(this);
        if (okClick != null)
            dlg.setOnButtonClickListener(MoboDialog.BUTTON_OK, okClick);
        dlg.showOnlyOK(text);
    }
 
    /**
     * An Mobo dialog voi 2 nut OK hoac Huy.
     */
    public void showOkDialog(String text) {
        showOkDialog(text, null);
    }
 
    public void showDialog(String message) {
        MoboDialog dlg = new MoboDialog(this);
        dlg.show();
    }

}
